<!DOCTYPE html>
<html>
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="utf-8">
  <title>模式识别从0构建—贝叶斯决策 | 前行的皮皮</title>
  <meta name="keywords" content=" python , 贝叶斯 ">
  <meta name="description" content="模式识别从0构建—贝叶斯决策 | 前行的皮皮">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="About me 我，网名孔皮皮，真名叫孔令宇，性别女，本科就读于大连海事大学，研究生学校未知。 既自以心为形役，奚惆怅而独悲。悟已往之不谏，知来者之可追。本科留了不少遗憾，但我还算想得开​​。 无冥冥之志者，无昭昭之明；无惛惛之事者，无赫赫之功。如果非要给自己学习找个理由的话，我应该是为了满足自己的好奇心。有幸的话，顺便给人类浩瀚的知识库添上那么一两笔。我喜欢聪明又勤奋的人，其中勤奋占的比重更大">
<meta property="og:type" content="website">
<meta property="og:title" content="about">
<meta property="og:url" content="http://yoursite.com/about/index.html">
<meta property="og:site_name" content="前行的皮皮">
<meta property="og:description" content="About me 我，网名孔皮皮，真名叫孔令宇，性别女，本科就读于大连海事大学，研究生学校未知。 既自以心为形役，奚惆怅而独悲。悟已往之不谏，知来者之可追。本科留了不少遗憾，但我还算想得开​​。 无冥冥之志者，无昭昭之明；无惛惛之事者，无赫赫之功。如果非要给自己学习找个理由的话，我应该是为了满足自己的好奇心。有幸的话，顺便给人类浩瀚的知识库添上那么一两笔。我喜欢聪明又勤奋的人，其中勤奋占的比重更大">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2019-04-25T17:13:04.314Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="about">
<meta name="twitter:description" content="About me 我，网名孔皮皮，真名叫孔令宇，性别女，本科就读于大连海事大学，研究生学校未知。 既自以心为形役，奚惆怅而独悲。悟已往之不谏，知来者之可追。本科留了不少遗憾，但我还算想得开​​。 无冥冥之志者，无昭昭之明；无惛惛之事者，无赫赫之功。如果非要给自己学习找个理由的话，我应该是为了满足自己的好奇心。有幸的话，顺便给人类浩瀚的知识库添上那么一两笔。我喜欢聪明又勤奋的人，其中勤奋占的比重更大">


<link rel="icon" href="/img/avatar.jpg">

<link rel="stylesheet" href="/css/style.css">

<link rel="stylesheet" href="/css/hl_theme/sublime.css">

<link href="//cdn.bootcss.com/animate.css/3.5.2/animate.min.css" rel="stylesheet">
<link href="//cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">

<script src="//cdn.bootcss.com/jquery/2.2.4/jquery.min.js"></script>
<script src="/js/jquery.autocomplete.min.js"></script>
<script src="//cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script>
<script>
    hljs.initHighlightingOnLoad();
</script>

<script src="//cdn.bootcss.com/nprogress/0.2.0/nprogress.min.js"></script>



<script src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>

<script src="/js/iconfont.js"></script>
</head>
<div style="display: none">
  <input class="theme_disqus_on" value="false">
  <input class="theme_preload_comment" value="false">
</div>
<body>
<aside class="nav">
    <div class="nav-left">
        <a href="/" class="avatar_target">
    <img class="avatar" src="/img/avatar.jpg">
</a>
<div class="author">
    <span>Kongpp</span>
</div>

<div class="icon">
    
        
    
        
        <a title="github" href="https://github.com/LingyvKong" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-github"/>
                </svg>
            
        </a>
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
    
        
        <a title="csdn" href="https://blog.csdn.net/kongxp_1" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-csdn"/>
                </svg>
            
        </a>
        
    
        
    
        
    
        
        <a title="email" href="mailto:konglyv@163.com" target="_blank">
            
                <svg class="iconfont-svg" aria-hidden="true">
                    <use xlink:href="#icon-email"/>
                </svg>
            
        </a>
        
    
</div>



<ul>
    <li class="all active">全部文章</li>
    
    <li data-rel="机器学习"> 机器学习 </li>
    
    <li data-rel="项目"> 项目 </li>
    
</ul>
<div class="left-bottom">
    <div class="menus">
    
    
    
    
    </div>
    <div><a style="border-right: 1px solid #fff; width: 49%" class="about site_url" href="/about">关于</a><a style="width: 50%" class="friends">友链</a></div>
</div>
<input type="hidden" id="yelog_site_posts_number" value="2">
<input type="hidden" id="yelog_site_word_count" value="1.6k">
<div style="display: none">
    <span id="busuanzi_value_site_uv"></span>
    <span id="busuanzi_value_site_pv"></span>
</div>
    </div>
    <div class="nav-right">
        <div class="friends-area">
    <div class="friends-title">
        友情链接
        <i class="back-title-list"></i>
    </div>
    <div class="friends-content">
        <ul>
            
            <li><a target="_blank" href="https://feichaiyu.github.io/">feichaiyu</a></li>
            
        </ul>
    </div>
</div>
        <div class="title-list">
    <form onkeydown="if(event.keyCode==13){return false;}">
        <input class="search" type="text" placeholder="以 in: 开头进行全文搜索" autocomplete="off" id="local-search-input">
        <i class="cross"></i>
        <span>
            <label for="tagswitch">Tags:</label>
            <input id="tagswitch" type="checkbox" style="display: none">
            <i id="tagsWitchIcon"></i>
        </span>
    </form>
    <div class="tags-list">
    
    <li class="article-tag-list-item">
        <a href="javascript:" class="color2">python</a>
    </li>
    
    <li class="article-tag-list-item">
        <a href="javascript:" class="color4">贝叶斯</a>
    </li>
    
    <li class="article-tag-list-item">
        <a href="javascript:" class="color3">线程</a>
    </li>
    
    <div class="clearfix"></div>
</div>

    
    <div id="local-search-result">

    </div>
    
    <nav id="title-list-nav">
        
        <a class="机器学习 " href="/2019/04/20/Bayes/" data-tag="python,贝叶斯" data-author>
            <span class="post-title" title="模式识别从0构建—贝叶斯决策">模式识别从0构建—贝叶斯决策</span>
            <span class="post-date" title="2019-04-20 23:35:58">2019/04/20</span>
        </a>
        
        <a class="项目 " href="/2019/04/20/multiprocess/" data-tag="python,线程" data-author>
            <span class="post-title" title="坑了好久的同步文件读取">坑了好久的同步文件读取</span>
            <span class="post-date" title="2019-04-20 23:35:58">2019/04/20</span>
        </a>
        
    </nav>
</div>
    </div>
    <div class="hide-list">
        <div class="semicircle">
            <div class="brackets first"><</div>
            <div class="brackets">&gt;</div>
        </div>
    </div>
</aside>
<div class="post">
    <div class="pjax">
        <article id="post-Bayes" class="article article-type-post" itemscope itemprop="blogPost">
    
        <h1 class="article-title">模式识别从0构建—贝叶斯决策</h1>
    
    <div class="article-meta">
        
        
        
        <span class="book">
            
            <a href="javascript:" data-rel="机器学习">机器学习</a>
            
        </span>
        
        
        <span class="tag">
            
            <a href="javascript:" class="color2">python</a>
            
            <a href="javascript:" class="color4">贝叶斯</a>
            
        </span>
        
    </div>
    <div class="article-meta">
        
        创建时间:<time class="date" title="更新时间: 2019-04-29 19:06:28">2019-04-20 23:35</time>
        
    </div>
    <div class="article-meta">
        
        <span>字数:1.2k</span>
        
        
        <span id="busuanzi_container_page_pv">
            阅读:<span id="busuanzi_value_page_pv">
                <span class="count-comment">
                    <span class="spinner">
                      <div class="cube1"></div>
                      <div class="cube2"></div>
                    </span>
                </span>
            </span>
        </span>
        
        
        <span class="top-comment" title="跳转至评论区">
            <a href="#comments">
                评论:<span class="count-comment">
                    <span class="spinner">
                      <div class="cube1"></div>
                      <div class="cube2"></div>
                    </span>
                </span>
            </a>
        </span>
        
    </div>
    
    <div class="toc-ref">
    
        <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#undefined"><span class="toc-text">模式识别从0构建—贝叶斯决策</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#一-原始记忆点-overview"><span class="toc-text">¶一、原始记忆点-overview</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#二-类条件概率估计"><span class="toc-text">¶二、类条件概率估计</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-参数估计"><span class="toc-text">¶1.参数估计</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-1-最大似然估计"><span class="toc-text">¶1.1 最大似然估计</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#1-2-最大后验概率估计-map"><span class="toc-text">¶1.2 最大后验概率估计（MAP）</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#2-非参数估计"><span class="toc-text">¶2.非参数估计</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#2-1-频率分布直方图"><span class="toc-text">¶2.1 频率分布直方图</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#2-2-parzen窗法"><span class="toc-text">¶2.2 Parzen窗法</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#均匀窗"><span class="toc-text">¶均匀窗</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#高斯窗"><span class="toc-text">¶高斯窗</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#三-决策面方程"><span class="toc-text">¶三、决策面方程</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#四-实验结果"><span class="toc-text">¶四、实验结果</span></a></li></ol></li></ol>
    
<style>
    .left-col .switch-btn,
    .left-col .switch-area {
        display: none;
    }
    .toc-level-3 i,
    .toc-level-3 ol {
        display: none !important;
    }
</style>
</div>
    <div class="article-entry" itemprop="articleBody">
      
        <h1>模式识别从0构建—贝叶斯决策</h1>
<blockquote>
<p>我刚开始写论文时东一棒槌西一棒槌，我导师说小伙子这样不行，写论文逻辑得顺，前后得有连接，要行云流水。他说我给你举个栗子：从前有座山，山里有座庙，庙里有个和尚，和尚……顿时豁然开朗。</p>
<p>——from 微博</p>
</blockquote>
<p>上面的引子挺有道理，不管是写论文还是学知识，感觉都是这个理。学校模式识别课第一部分讲贝叶斯决策，感觉有的人学的稀里糊涂，没把知识串起来，当然实验也不会做。其实挺简单的，做个简单总结吧。</p>
<p><font color="red">以下内容中行间公式为代码中用到的公式</font></p>
<hr>
<h2 id="一-原始记忆点-overview"><a class="header-anchor" href="#一-原始记忆点-overview">¶</a>一、原始记忆点-overview</h2>
<p>贝叶斯决策说到底还是从贝叶斯公式（全概率公式）说起：<br>
$$<br>
p(w|x)=\frac{p(x|w)p(w)}{p(x)}<br>
$$</p>
<p>$x$可以理解为观测到的样本的情况，$w$为样本属于的类别。只需要用上述公式计算在这种观测下，样本属于每个类别的概率，对于基于最小错误率的贝叶斯决策，哪个概率大就判断为哪一类即可（其中他们的分母一样可忽略）。简单粗暴。（当然，此外还有基于最小风险的贝叶斯决策，Neyman-Pearson决策，最小最大决策。我想让此博客更关注整体框架和逻辑，因此这些决策按下不表。）</p>
<p>但是实际应用的时候问题就来了，$p(x|w)$和$p(w)$是多少。$p(w)$简单，可以直接由训练集中某个类别出现的频率代替。<font color="red"><code>猜测：这里需要训练样本独立、随机采样什么的</code></font>  那么类条件概率$p(x|w)​$呢？</p>
<h2 id="二-类条件概率估计"><a class="header-anchor" href="#二-类条件概率估计">¶</a>二、类条件概率估计</h2>
<h3 id="1-参数估计"><a class="header-anchor" href="#1-参数估计">¶</a>1.参数估计</h3>
<p>参数估计就是已经知道或者假定样本服从某种分布，只是其中的参数不知道，需要靠我们推算出来。这里以<strong>正态分布</strong>为例，给出推导结果。推导过程请参考教材ppt。</p>
<h4 id="1-1-最大似然估计"><a class="header-anchor" href="#1-1-最大似然估计">¶</a>1.1 最大似然估计</h4>
<p>最大似然估计就是根据已经抽取的n个样本$x_1,x_2,…,x_n$估计这组样本最可能来自哪个概率密度函数。也就是求解让这些样本出现的联合概密最大的参数，即  $\hat\theta_{ML}=\mathop{\arg\max_{\theta}}\sum_{i=1}^{n}\ln{p(x_i;\theta)}$</p>
<p>正态分布的均值和方差的求解结果为：</p>

$$
\hat{\mu}_{ML}=\frac{1}{n}\sum^{n}_{i=1}x_i=bar(x)
$$

$$
\hat{\Sigma}_{ML}=\frac{1}{n}\sum_{i=1}^{n}(x_i-\hat{\mu}_{ML})(x_i-\hat{\mu}_{ML})^T
$$

<h4 id="1-2-最大后验概率估计-map"><a class="header-anchor" href="#1-2-最大后验概率估计-map">¶</a>1.2 最大后验概率估计（MAP）</h4>
<p>最大后验概率估计的思想是：把待估计的参数看作随机变量，希望使后验概率最大。即  $\hat{\theta}_{MAP}=\arg\max_\theta{p(\theta|X)}$</p>
<h3 id="2-非参数估计"><a class="header-anchor" href="#2-非参数估计">¶</a>2.非参数估计</h3>
<h4 id="2-1-频率分布直方图"><a class="header-anchor" href="#2-1-频率分布直方图">¶</a>2.1 频率分布直方图</h4>
<p>白话来说，就是把值域分成几个小区间，然后统计落在每个小区间的频率。然后，为了让整个图的积分为1，要将频率除以h，h为区间宽度。</p>
<h4 id="2-2-parzen窗法"><a class="header-anchor" href="#2-2-parzen窗法">¶</a>2.2 Parzen窗法</h4>
<p>parzen窗法有两种理解角度：</p>
<ul>
<li>
<p>第一种角度：（上帝视角）体现在代码里就是遍历分布的自变量</p>
<p>是对频数的加权统计（根据核函数加权）</p>
</li>
<li>
<p>第二种角度：（群众视角）体现在代码里就是遍历每个样本</p>
<p>每个样本对分布所做的贡献，对自己所在位置的分布贡献最大，离得越远，贡献越小。</p>
</li>
</ul>
<p>公式为：</p>

$$
\hat{p}_n(x)=\frac{1}{nh_n^d}\sum_{i=1}^{n}k(\frac{x-x_i}{h_n})
$$

<p>其中$h_n$是控制“窗”宽度的参数，$d$代表特征的维度，$n$为样本数，$k()$为核函数。$\frac{x-x_i}{h_n}$的作用是把样本值归一化到$[-\frac{1}{2},\frac{1}{2}]$.</p>
<h5 id="均匀窗"><a class="header-anchor" href="#均匀窗">¶</a>均匀窗</h5>

$x=(x^1,x^2,...,x^d)\mathcal\in{R}^d$

$$
k(x)=\left\{\begin{array}{cc} 
		1, & \left|x^i\right|\leq1/2\quad i=1,2,...,d\\ 
		0, & other\ values 
\end{array}\right.
$$

<h5 id="高斯窗"><a class="header-anchor" href="#高斯窗">¶</a>高斯窗</h5>
<p>$$<br>
k(x)=\frac{1}{\sqrt{2\pi}}\exp(-\frac{\Vert x\Vert^2}{2})<br>
$$</p>
<h2 id="三-决策面方程"><a class="header-anchor" href="#三-决策面方程">¶</a>三、决策面方程</h2>
<p>决策面即是两类的概率$p(w_i|x)$和$p(w_j|x)$相等的时候。通用的决策面方程为：</p>

$$
\begin{split}
& g_i(x)-g_j(x)\\
& =-\frac{1}{2}[(x-\mu_i)\Sigma_i^{-1}(x-\mu_i)-(x-\mu_j)\Sigma_j^{-1}(x-\mu_j)]-\frac{1}{2}\ln{\frac{\vert \Sigma_i\vert}{\vert \Sigma_j\vert}}+\ln{\frac{P(w_i)}{P(w_j)}} \\
& =0
\end{split}
$$

<p>针对三种情况，有进一步化简的决策面方程，但是个人感觉实用性不强，在此按下不表。</p>
<h2 id="四-实验结果"><a class="header-anchor" href="#四-实验结果">¶</a>四、实验结果</h2>
<p>使用MATLAB完成实验，源代码及数据集已上传到<a href="https://github.com/LingyvKong/PatternRecognition-with-matlab/tree/master/Bayes" target="_blank" rel="noopener">Github</a></p>
<p><img src="/2019/04/20/Bayes/1_3.jpg" alt="girldata"></p>
<hr>
<p><img src="/2019/04/20/Bayes/1_2.jpg" alt="GIRLdata"></p>
<hr>
<p><img src="/2019/04/20/Bayes/1_1.jpg" alt="boydata"></p>

      
       <hr><span style="font-style: italic;color: gray;"> 转载请注明来源，欢迎在下面评论区评论 </span>
    </div>
</article>


<p>
    <a href="javascript:void(0)" class="dashang" onclick="dashangToggle()">赏</a>
</p>



    <div id="comments"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">

<script type="text/javascript">
    $.getScript('https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', function () {
        var gitalk = new Gitalk({
            clientID: 'e942070b8b25d6da1d2d',
            clientSecret: '9d562859e59a9ae2c409d1d5e9c157f41e167b77',
            repo: 'LingyvKong.github.io',
            owner: 'LingyvKong',
            admin: ['LingyvKong'],
            id: location.pathname,
            distractionFreeMode: 'true',
            language: 'zh-CN',
            perPage: parseInt('10',10)
        })
        gitalk.render('comments')
    })
</script>



    
        <!-- MathJax配置，可通过单美元符号书写行内公式等 -->
<script type="text/x-mathjax-config">
    MathJax.Hub.Config({
    "HTML-CSS": {
        preferredFont: "TeX",
        availableFonts: ["STIX","TeX"],
        linebreaks: { automatic:true },
        EqnChunk: (MathJax.Hub.Browser.isMobile ? 10 : 50)
    },
    tex2jax: {
        inlineMath: [ ["$", "$"], ["\\(","\\)"] ],
        processEscapes: true,
        ignoreClass: "tex2jax_ignore|dno",
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
    },
    TeX: {
        equationNumbers: { autoNumber: "AMS" },
        noUndefined: { attributes: { mathcolor: "red", mathbackground: "#FFEEEE", mathsize: "90%" } },
        Macros: { href: "{}" }
    },
    messageStyle: "none"
    });
</script>
<!-- 给MathJax元素添加has-jax class -->
<script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for(i=0; i < all.length; i += 1) {
            all[i].SourceElement().parentNode.className += ' has-jax';
        }
    });
</script>
<!-- 通过连接CDN加载MathJax的js代码 -->
<script type="text/javascript" async src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<input type="hidden" id="MathJax-js" value="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

    

    </div>
    <div class="copyright">
        <p class="footer-entry">©2019 Kongpp</p>
<p class="footer-entry">Built with <a href="https://hexo.io/" target="_blank">Hexo</a> and <a href="https://github.com/yelog/hexo-theme-3-hexo" target="_blank">3-hexo</a> theme</p>

    </div>
    <div class="full-toc">
        <button class="full"><span class="min "></span></button>
<button class="post-toc-menu"><span class="post-toc-menu-icons"></span></button>
<div class="post-toc"><span class="post-toc-title">目录</span>
    <div class="post-toc-content">

    </div>
</div>
<a class id="rocket" href="javascript:void(0)"></a>
    </div>
</div>
<div class="acParent"></div>

<div class="hide_box" onclick="dashangToggle()"></div>
<div class="shang_box">
    <a class="shang_close" href="javascript:void(0)" onclick="dashangToggle()">×</a>
    <div class="shang_tit">
        <p>喜欢就点赞,疼爱就打赏</p>
    </div>
    <div class="shang_payimg">
        <div class="pay_img">
            <img src="/img/alipay.jpg" class="alipay" title="扫码支持">
            <img src="/img/weixin.jpg" class="weixin" title="扫码支持">
        </div>
    </div>
    <div class="shang_payselect">
        <span><label><input type="radio" name="pay" checked value="alipay">支付宝</label></span><span><label><input type="radio" name="pay" value="weixin">微信</label></span>
    </div>
</div>

</body>
<script src="//cdn.bootcss.com/jquery.pjax/2.0.1/jquery.pjax.min.js"></script>

<script src="/js/script.js"></script>
<script>
    var img_resize = 'default';
    /*作者、标签的自动补全*/
    $(function () {
        $('.search').AutoComplete({
            'data': ['#python','#贝叶斯','#线程',],
            'itemHeight': 20,
            'width': 418
        }).AutoComplete('show');
    })
    function initArticle() {
        /*渲染对应的表格样式*/
        
            $(".post .pjax table").addClass("green_title");
        

        /*渲染打赏样式*/
        
        $("input[name=pay]").on("click", function () {
            if($("input[name=pay]:checked").val()=="weixin"){
                $(".shang_box .shang_payimg .pay_img").addClass("weixin_img");
            } else {
                $(".shang_box .shang_payimg .pay_img").removeClass("weixin_img");
            }
        })
        

        /*高亮代码块行号*/
        
        $('pre code').each(function(){
            var lines = $(this).text().split('\n').length - 1;
            var $numbering = $('<ul/>').addClass('pre-numbering').attr("unselectable","on");
            $(this).addClass('has-numbering')
                    .parent()
                    .append($numbering);
            for(i=1;i<=lines;i++){
                $numbering.append($('<li/>').text(i));
            }
        });
        

        /*访问数量*/
        
        $.getScript("//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js");
        

        /*代码高亮，行号对齐*/
        $('.pre-numbering').css('line-height',$('.has-numbering').css('line-height'));

        
    }

    /*打赏页面隐藏与展示*/
    
    function dashangToggle() {
        $(".shang_box").fadeToggle();
        $(".hide_box").fadeToggle();
    }
    

</script>

<!--加入行号的高亮代码块样式-->

<style>
    pre{
        position: relative;
        margin-bottom: 24px;
        border-radius: 10px;
        border: 2px solid #e2dede;
        background: #FFF;
        overflow: hidden;
    }
    code.has-numbering{
        margin-left: 30px;
    }
    .pre-numbering{
        margin: 0px;
        position: absolute;
        top: 0;
        left: 0;
        width: 20px;
        padding: 0.5em 3px 0.7em 5px;
        border-right: 1px solid #C3CCD0;
        text-align: right;
        color: #AAA;
        background-color: ;
    }
</style>

<!--自定义样式设置-->
<style>
    
    .nav-right nav a.hover, #local-search-result a.hover{
        background-color: #1F9F85;
    }
    
    
    .nav-right nav a.hover > span{
        color: #ffffff;
    }
    

    /*列表样式*/
    
    .post .pjax article .article-entry>ol, .post .pjax article .article-entry>ul, .post .pjax article>ol, .post .pjax article>ul{
        border: #e2dede solid 2px;
        border-radius: 10px;
        padding: 10px 32px 10px 56px;
    }
    .post .pjax article .article-entry li>ol, .post .pjax article .article-entry li>ul,.post .pjax article li>ol, .post .pjax article li>ul{
        padding-top: 5px;
        padding-bottom: 5px;
    }
    .post .pjax article .article-entry>ol>li, .post .pjax article .article-entry>ul>li,.post .pjax article>ol>li, .post .pjax article>ul>li{
        margin-bottom: auto;
        margin-left: auto;
    }
    .post .pjax article .article-entry li>ol>li, .post .pjax article .article-entry li>ul>li,.post .pjax article li>ol>li, .post .pjax article li>ul>li{
        margin-bottom: auto;
        margin-left: auto;
    }
    

    /*引用块样式*/
    

    /*文章列表背景图*/
    
    .nav-right:before {
        content: ' ';
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: 0.4;
        background: url("http://ppmjd1g3u.bkt.clouddn.com/img_0001.jpg");
        background-repeat: no-repeat;
        background-position: 50% 0;
        -ms-background-size: cover;
        -o-background-size: cover;
        -moz-background-size: cover;
        -webkit-background-size: cover;
        background-size: cover;
    }
    
</style>






</html>
